package com.demo.dao.user;

import com.demo.entity.employee.Employee;
import com.demo.entity.user.UserCustom;
import com.demo.entity.user.UserQueryVo;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;

/**
 * http://www.cnblogs.com/wangmingshun/p/5674633.html
 * 1、采用MapperScannerConfigurer，它将会查找类路径下的映射器并自动将它们创建成MapperFactoryBean。
 * spring-mybatis.xml:
 */
//@MapperScan
public interface UserCustomDao {
	
    //---------------------------查找--------------------------------//
	
    //查找:传递包装类型对象
    List<UserCustom> findUserCustomList(UserQueryVo userQueryVo);
    
    //传递HashMap
    List<UserCustom> findUserCustomListHashmap(HashMap<String, Object> map);

    //返回int
    int  findUserCustomCount(UserQueryVo userQueryVo);


    //---------------------------插入------------------------------------//
    @Insert("insert into t_usercustom (id, userId, homeAddress,  companyAddress) \r\n" +
            "        values (#{id,jdbcType=INTEGER},#{userId,jdbcType=INTEGER},  #{homeAddress,jdbcType=VARCHAR},\r\n" +
            "        #{companyAddress,jdbcType=VARCHAR})")
    int insertUserCustom(@Param("userCustom") UserCustom userCustom);
}
